//配置路由映射表 根据表中数据遍历出Route Redirect
import Home from '../views/Home'
import List from '../views/List'
import My from '../views/My'
import Error404 from '../views/Error404'
import Login from '../views/User/login'
//二级路由
import Home1 from '../views/Home/child/home1'
import Home2 from '../views/Home/child/home2'
const routes = [
  {
    path: '/home',
    component: Home,
    title: '首页',
    children: [
      {
        path: '/home/home1',
        component: Home1,
        title: '首页111',
      },
      {
        path: '/home/home2',
        component: Home2,
        title: '首页222',
      },
      {
        from: '/home',
        to: '/home/home1'
      }, {
        to: '/404'
      }
    ]
  },
  {
    path: '/list',
    component: List,
    title: '列表',
  },
  {
    path: '/login',
    component: Login,
    title: '登录',
  },
  {
    path: '/my',
    component: My,
    title: '我的',
  },
  {
    to: '/404',
    component: Error404
  },
  {
    //配置重定向
    from: '/',
    to: '/home'
  }

]
export default routes
